package testJdk.base.classloader;

/**
 * @Description : 类描述
 * Created by cyd on 2021-05-12 20:32:49
 */
public class TestClassLoader {
    public static void main(String[] args) throws ClassNotFoundException {
        ClassLoader classLoader = TestClassLoader.class.getClassLoader();

        System.out.println("classLoader: " + classLoader);

        System.out.println("parent of classLoader: " + classLoader.getParent());

        System.out.println("grandparent of classLoader: " + classLoader.getParent().getParent());

        ClassLoader stringClassLoader = String.class.getClassLoader();

        System.out.println("stringClassLoader: " + stringClassLoader);

        System.out.println(classLoader.loadClass("java.util.List").getClassLoader());

        //System.out.println("bootstrap classloader: " + System.getProperty("sun.boot.class"));

        System.out.println("extention 加载目录: " + System.getProperty("java.ext.dir"));

        System.out.println("appclassloader加载目录: " + System.getProperty("java.class.path"));

    }
}
